package service

import (
	"context"
	pb "mytest/gokit/proto/hello"
	"mytest/util"
)

// NewService returns a naïve, stateless implementation of Service.
func NewService() pb.HelloServer {
	return helloService{}
}

type helloService struct{}

func (s helloService) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloResponse, error) {
	var resp pb.HelloResponse
	msg := in.Name
	resp.Message = util.FirstUpper(msg)
	return &resp, nil
}
